<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>会计科目数据列表</title>
	<include file="Public:header" />
	<style type="text/css">
		.input{width:150px;border:1px solid #ccc;padding:2px;}
	</style>
	<script type="text/javascript">
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		function delete_todo()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要删除的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$.messager.confirm('询问', '确认要删除选中的项吗？', function(r){
					if (r){
						//todo...
						window.location.href="{:U('Finance/faccmas_del')}"+actflg+"id="+selChk+"";
					}
				});
			}
		}
		function selectall_todo()
		{
			$("input[name='chk_list']").attr("checked",true);
		}
		function selectall_undo()
		{
			$("input[name='chk_list']").attr("checked",false);
		}
	</script>
</head>
<body class="">

<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div>会计科目设置</div>
		<div>
		<form id="frm_search" method="post" action="{:U('Finance/faccmas_list')}" style="margin:10px auto 0px 25px;">
		<div style="float:left; margin:0px; padding:2px;">
		<select id="pid" name="pid" class="easyui-combobox" editable="false" style="width:190px;">
								<option value='0'>科目分类</option>
								<volist name='classlist' id="classlist">
								<option value='{$classlist["id"]}'>{$classlist['code']} {$classlist['title']}</option>
								</volist>
		</select>
		</div>
		<script type="text/javascript">$("#pid").attr("value","{$pid}");</script>
		<input type="text" id="keywords" name="keywords" class="input" value="{$keywords}" />
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-search" onclick="$('#frm_search').submit();">搜索</a>
		</form>
		</div>
</div>


	
<div class="space-out-10px">
	
	<div class="list-title">
		<div class="list-t-l w50px"></div>
		<div class="list-t-l w60px">ID</div>
		<div class="list-t-l w350px">科目</div>
		<div class="list-t-l w50px">状态</div>
		<div class="list-t-l">操作</div>
		<div class="list-t-r">
		<a href="{:U('Finance/faccmas_list')}" class="easyui-linkbutton" iconCls="icon-reload">刷新</a>
		<a href="{:U('Finance/faccmas_add')}" class="easyui-linkbutton" iconCls="icon-add">新增会计科目</a>
		</div>
	</div>
	
	<div class="list-box">
	<volist name="datalist" id="datalist">
	<php>$diyinfo=unserialize($datalist['diyinfo']);</php>
	<div class="list-body">
		<div class="list-t-l w50px"><input type="checkbox" name="chk_list" value="{$datalist.id}" style="margin-top:6px;" /></div>
		<div class="list-t-l w60px">{$datalist.id}</div>
		<div class="list-t-l w350px"><for start="3" end="$datalist['count']">
				<span class="tree-indent"></span><span class="tree-indent"></span></for><span class="tree-hit tree-expanded tree-expanded-hover"></span><font color="<php>if($diyinfo['credit']=='Y'){echo '#aa0000';}else{echo '#0000aa';}</php>">{$datalist.code} {$datalist.title}</font>
				<php>
				if($diyinfo['bank']=='Y'){echo '[银行]';}
				if($diyinfo['arctrl']=='Y'){echo '[应收]';}
				if($diyinfo['apctrl']=='Y'){echo '[应付]';}
				if($diyinfo['precollected']=='Y'){echo '[预收]';}
				if($diyinfo['prepaid']=='Y'){echo '[预付]';}
				if($diyinfo['profit']=='Y'){echo '[收益]';}
				</php>
		</div>
		<div class="list-t-l w50px"><img src="__PUBLIC__/Images/{$datalist.status_flg}.png" alt="{$datalist.status_flg}" title="{$datalist.status_flg}" /></div>
		<div class="list-t-l"><a href="{:U('Finance/faccmas_edit?id='.$datalist['id'].'')}">编辑</a>&nbsp;-&nbsp;
		<a href="{:U('Finance/faccmas_add?pid='.$datalist['id'].'')}">新增下级科目</a>
		</div>
	</div>
	</volist>
	</div>

</div>
	
<div class="space-out-5px">	
	<div class="list-title">
		<div class="list-t-l">操作：<a href="javascript:;" onclick="selectall_todo()">全选</a> - <a href="javascript:;" onclick="selectall_undo()">取消选择</a> - <a href="javascript:;" onclick="delete_todo()">禁用已选项</a></div>
		<div class="list-t-r">
		<a href="{:U('Finance/faccmas_list')}" class="easyui-linkbutton" iconCls="icon-reload">刷新</a>
		<a href="{:U('Finance/faccmas_add')}" class="easyui-linkbutton" iconCls="icon-add">新增会计科目</a>
		</div>
	</div>	
</div>

</body>
</html>
